package com.tanhua.server.controller;

import com.tanhua.dubbo.pojo.Answers;

import com.tanhua.server.service.TestSoulService;
import com.tanhua.server.vo.ConclusionVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.tanhua.server.vo.PaperListVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@RestController
@RequestMapping("testSoul")
@Slf4j
public class TestSoulController {

    @Autowired
    private TestSoulService testSoulService;

    /**
     * @MethodName: getReport
     * @Description: 测灵魂-查看结果
     */

    @GetMapping("/report/{id}")
    public ConclusionVo getReport(@PathVariable("id") String id) {
            return  testSoulService.getReport(id);
    }
    /* 提交问卷
     * @param map
     * @return
     */
    @PostMapping
    public String submitTestPaper(@RequestBody Map<String, List<Answers>> map){

          return   this.testSoulService.submitTestPaper(map);
    }

    /**
     * 显示试题
     * @return
     */
    @GetMapping
    public List<PaperListVo> paperList() {
            return  this.testSoulService.queryPaperList();
    }
}

